﻿@model EquationsBankSite.Models.Helpers.TreeNode<string>

<li>
    @if (Model.Data != null)
    {
        if (Model.Children.Any())
        {
            <span class="folder">@Model.Data</span>
        }
        else
        {
            @Html.ActionLink(Model.Data.Split('@')[0], "Index", new { pathId = int.Parse(Model.Data.Split('@')[1]) }, new { @class="file" }) 
        }
    }


    @foreach (var node in Model.Children)
    {
        <ul>@Html.Partial("_FieldCategory", node)</ul>
    }
</li>